package com.proxy;

import java.io.Serializable;

/**
 * User: yuanjianpeng
 * Date: 2019/1/12
 * Project: webServiceServerTest
 * Version: 1.0
 * Description:
 */
public class Result<T> implements Serializable {
    private boolean success;
    private T result;
    private String errorCode;
    private String errorMsg;

    public Result(){
    }

    public Result(T result){
        this.success = true;
        this.result = result;
    }

    public Result(String errorCode, String errorMsg){
        this.success = false;
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public boolean isSuccess() {
        return this.success;
    }

    public void setResult(T result){
        this.success = true;
        this.result = result;
    }

    public T getResult(){
        return this.result;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }
}
